package com.wmh.baseservice.skd.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wmh.baseservice.skd.pojo.SkdPickupPoint;
import com.wmh.baseservice.skd.pojo.dto.NearbyPickupPointDTO;
import com.wmh.baseservice.skd.service.SkdPickupPointService;
import com.wmh.baseservice.skd.mapper.SkdPickupPointMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author CH
* @description 针对表【skd_pickup_point】的数据库操作Service实现
* @createDate 2023-12-28 10:15:30
*/
@Service
public class SkdPickupPointServiceImpl extends ServiceImpl<SkdPickupPointMapper, SkdPickupPoint>
    implements SkdPickupPointService{
    @Resource
    private SkdPickupPointMapper skdPickupPointMapper;

    @Override
    public List<SkdPickupPoint> queryPickupPoints(Long usId, String queryName, Integer categoryId) {
        return skdPickupPointMapper.queryPickupPoints(usId, queryName, categoryId);
    }

    /**
     * 根据经纬度获取附近自提点
     * @param lat 经度
     * @param lng 纬度
     * @return 返回自提点id列表
     */
    @Override
    public List<NearbyPickupPointDTO> getNearbyPickupPoints(String lat, String lng) {
        return skdPickupPointMapper.getNearbyPickupPoints(lat, lng);
    }
}